// 动画样式

// 关键帧动画
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes zoomOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.3);
    opacity: 0;
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes loading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes wave {
  0%, 60%, 100% {
    transform: initial;
  }
  30% {
    transform: translateY(-15px);
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--el-color-primary);
  }
  50% {
    box-shadow: 0 0 20px var(--el-color-primary), 0 0 30px var(--el-color-primary);
  }
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

// 动画类
.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.animate-fade-out {
  animation: fadeOut 0.3s ease-in-out;
}

.animate-slide-in-up {
  animation: slideInUp 0.3s ease-out;
}

.animate-slide-in-down {
  animation: slideInDown 0.3s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.3s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

.animate-zoom-in {
  animation: zoomIn 0.3s ease-out;
}

.animate-zoom-out {
  animation: zoomOut 0.3s ease-out;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-loading {
  animation: loading 1s linear infinite;
}

.animate-wave {
  animation: wave 1.5s ease-in-out infinite;
}

.animate-typing {
  animation: typing 2s steps(40, end);
}

.animate-blink {
  animation: blink 1s infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

.animate-slide-down {
  animation: slideDown 0.3s ease-out;
}

// 延迟动画
.animate-delay-100 {
  animation-delay: 0.1s;
}

.animate-delay-200 {
  animation-delay: 0.2s;
}

.animate-delay-300 {
  animation-delay: 0.3s;
}

.animate-delay-500 {
  animation-delay: 0.5s;
}

.animate-delay-700 {
  animation-delay: 0.7s;
}

.animate-delay-1000 {
  animation-delay: 1s;
}

// 动画持续时间
.animate-duration-75 {
  animation-duration: 75ms;
}

.animate-duration-100 {
  animation-duration: 100ms;
}

.animate-duration-150 {
  animation-duration: 150ms;
}

.animate-duration-200 {
  animation-duration: 200ms;
}

.animate-duration-300 {
  animation-duration: 300ms;
}

.animate-duration-500 {
  animation-duration: 500ms;
}

.animate-duration-700 {
  animation-duration: 700ms;
}

.animate-duration-1000 {
  animation-duration: 1000ms;
}

// 动画缓动函数
.animate-ease-linear {
  animation-timing-function: linear;
}

.animate-ease-in {
  animation-timing-function: ease-in;
}

.animate-ease-out {
  animation-timing-function: ease-out;
}

.animate-ease-in-out {
  animation-timing-function: ease-in-out;
}

// 无限循环
.animate-infinite {
  animation-iteration-count: infinite;
}

// 动画播放状态
.animate-paused {
  animation-play-state: paused;
}

.animate-running {
  animation-play-state: running;
}

// 过渡效果
.transition-all {
  transition: all 0.3s ease;
}

.transition-colors {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.transition-opacity {
  transition: opacity 0.3s ease;
}

.transition-shadow {
  transition: box-shadow 0.3s ease;
}

.transition-transform {
  transition: transform 0.3s ease;
}

.transition-none {
  transition: none;
}

// 悬停效果
.hover-scale:hover {
  transform: scale(1.05);
}

.hover-scale-sm:hover {
  transform: scale(1.02);
}

.hover-scale-lg:hover {
  transform: scale(1.1);
}

.hover-shadow:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-shadow-lg:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

.hover-lift-lg:hover {
  transform: translateY(-4px);
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

.hover-rotate-lg:hover {
  transform: rotate(10deg);
}

// 加载动画
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--el-border-color-lighter);
  border-radius: 50%;
  border-top-color: var(--el-color-primary);
  animation: spin 1s linear infinite;
}

.loading-dots {
  display: inline-block;
  
  &::after {
    content: '...';
    animation: loading-dots 1.5s steps(4, end) infinite;
  }
}

@keyframes loading-dots {
  0%, 20% {
    color: transparent;
    text-shadow: 0.25em 0 0 transparent, 0.5em 0 0 transparent;
  }
  40% {
    color: var(--el-text-color-primary);
    text-shadow: 0.25em 0 0 transparent, 0.5em 0 0 transparent;
  }
  60% {
    text-shadow: 0.25em 0 0 var(--el-text-color-primary), 0.5em 0 0 transparent;
  }
  80%, 100% {
    text-shadow: 0.25em 0 0 var(--el-text-color-primary), 0.5em 0 0 var(--el-text-color-primary);
  }
}

// 进度条动画
.progress-indeterminate {
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--el-color-primary), transparent);
    animation: progress-indeterminate 2s linear infinite;
  }
}

@keyframes progress-indeterminate {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

// 呼吸灯效果
.breathing {
  animation: breathing 2s ease-in-out infinite;
}

@keyframes breathing {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

// 闪烁效果
.flashing {
  animation: flashing 1s ease-in-out infinite;
}

@keyframes flashing {
  0%, 50%, 100% {
    opacity: 1;
  }
  25%, 75% {
    opacity: 0.5;
  }
}

// 数字滚动效果
.number-roll {
  display: inline-block;
  animation: number-roll 0.5s ease-out;
}

@keyframes number-roll {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

// 卡片翻转效果
.card-flip {
  perspective: 1000px;
  
  .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
  }
  
  &:hover .card-inner {
    transform: rotateY(180deg);
  }
  
  .card-front,
  .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
  }
  
  .card-back {
    transform: rotateY(180deg);
  }
}

// 波纹效果
.ripple {
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }
  
  &:active::before {
    width: 300px;
    height: 300px;
  }
}